﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FriendLinkCheck.aspx.cs"
    Inherits="WinnerCMS.WebUI.Admin.FriendLink.FriendLinkCheck" %>

<!doctype html>
<html>
<head runat="server">
    <title>友情链接检查</title>
    <meta charset="utf-8" />
    <meta http-equiv="Pragma" content="No-cach" />
    <%: Styles.Render("~/Content/Bootstrap/css") %>
    <%: Scripts.Render("~/Scripts/AdminBase") %>
    <script type="text/javascript">
        function check(type, checkurl, id) {
            $.ajax({
                type: "post",
                dataType: "JSON",
                url: "FriendLinkAJAX.ashx?Action=" + type + "&URL=" + checkurl + "&m=" + Math.random(),
                beforeSend: function () {

                },
                success: function (data) {
                    $("#" + id).html(data);
                }
            });
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <asp:TextBox ID="txtURL" runat="server" Width="271px"></asp:TextBox>
    <asp:Button ID="btnOK" runat="server" Cssclass="btn btn-default" Text="分析" OnClick="btnOK_Click" />
    <asp:GridView ID="GV_List" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" GridLines="None" CssClass="table table-bordered table-condensed table-hover">
        <Columns>
            <asp:BoundField DataField="Title" HeaderText="网站名称">
                <ItemStyle Width="80px" />
            </asp:BoundField>
            <asp:BoundField DataField="URL" HeaderText="网址" />
            <asp:TemplateField HeaderText="分析">
                <ItemTemplate>
                    <span id="sp_Link_<%# Eval("ID") %>">正在分析</span>

                    <script type="text/javascript">
                        check('Link', '<%# Eval("URL") %>', 'sp_Link_<%# Eval("ID") %>');
                    </script>

                </ItemTemplate>
                <ItemStyle Width="80px" HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="百度收录">
                <ItemTemplate>
                    <span id="sp_Baidu_<%# Eval("ID") %>">正在分析</span>

                    <script type="text/javascript">
                        check('Baidu', '<%# Eval("URL") %>', 'sp_Baidu_<%# Eval("ID") %>');
                    </script>

                </ItemTemplate>
                <ItemStyle HorizontalAlign="Right" Width="60px" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="谷歌收录">
                <ItemTemplate>
                    <span id="sp_Google_<%# Eval("ID") %>">正在分析</span>

                    <script type="text/javascript">
                        check('Google', '<%# Eval("URL") %>', 'sp_Google_<%# Eval("ID") %>');
                    </script>

                </ItemTemplate>
                <ItemStyle HorizontalAlign="Right" Width="60px" />
            </asp:TemplateField>
          
            <asp:TemplateField HeaderText="Alexa">
                <ItemTemplate>
                    <span id="sp_Alexa_<%# Eval("ID") %>">正在分析</span>

                    <script type="text/javascript">                        check('Alexa', '<%# Eval("URL") %>', 'sp_Alexa_<%# Eval("ID") %>')</script>

                </ItemTemplate>
                <ItemStyle Width="60px" HorizontalAlign="Right" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Yahoo">
                <ItemTemplate>
                    <span id="sp_Yahoo_<%# Eval("ID") %>">正在分析</span>

                    <script type="text/javascript">                        check('Yahoo', '<%# Eval("URL") %>', 'sp_Yahoo_<%# Eval("ID") %>')</script>

                </ItemTemplate>
                <ItemStyle Width="60px" HorizontalAlign="Right" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="SoGou">
                <ItemTemplate>
                    <span id="sp_SoGou_<%# Eval("ID") %>">正在分析</span>

                    <script type="text/javascript">                        check('SoGou', '<%# Eval("URL") %>', 'sp_SoGou_<%# Eval("ID") %>')</script>

                </ItemTemplate>
                <ItemStyle Width="60px" HorizontalAlign="Right" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="SoSo">
                <ItemTemplate>
                    <span id="sp_SoSo_<%# Eval("ID") %>">正在分析</span>

                    <script type="text/javascript">
                        check('SoSo', '<%# Eval("URL") %>', 'sp_SoSo_<%# Eval("ID") %>');
                    </script>

                </ItemTemplate>
                <ItemStyle Width="60px" HorizontalAlign="Right" />
            </asp:TemplateField>
        </Columns>
        <HeaderStyle CssClass="HeaderStyle" />
    </asp:GridView>
    </form>
</body>
</html>
